from django.db import models


# Create your models here.

class Book(models.Model):
    name = models.CharField(max_length=20, verbose_name="书名")
    price = models.DecimalField(max_digits=6, decimal_places=2, verbose_name="价格")
    author = models.CharField(max_length=20, verbose_name="作者")
    pic = models.ImageField(upload_to="static/pic", verbose_name="封面")

    class Meta:
        db_table = "books"
        verbose_name = "书"
        verbose_name_plural = verbose_name
